//ReturnArray.java
package com.xyc.ch7;
public class ReturnArray
{
	public static void main(String[] args)
	{
		int[] a1={10,4,2,};
		int[] a2;
		for(int i=0;i<a1.length;i++)
			System.out.print(" a1["+i+"]="+a1[i]);
		System.out.println();

		a2=copyArray(a1);

		for(int i=0;i<a2.length;i++)
			System.out.print(" a2["+i+"]="+a2[i]);
		System.out.println();
	}

	public static int[] copyArray(int[] la)
	{
		int [] a=new int[la.length];
		for(int i=0;i<la.length;i++)
			a[i]=la[i];
		return a;
	}
}

